<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/jsps/common/taglibs.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>赎回基金列表</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

	<link rel="stylesheet" type="text/css" href='<c:url value="/css/application.css"/>'>
	<link rel="stylesheet" type="text/css" href='<c:url value="/css/list.css"/>'>
	<link rel="stylesheet" type="text/css" href='<c:url value="/css/form.css"/>'>
	<script type="text/javascript" src="<c:url value="/js/common.js"/>"></script>

<script type="text/javascript">
	function sell(fundNo,accountNo){
		location.href = '<c:url value="fundMgr?act=selldetail"/>&fund_no='+fundNo+'&account_no='+accountNo;
	}
	
	function doQuery(pageno){
		if(pageno<1 || pageno>${page.totalPageNum}){
			alert("页号超出范围，有效范围：[1-${page.totalPageNum}]");
			$('pageNo').select();
			return;
		}
		var f=document.forms[0];
		f.action=f.action+"&pageno="+pageno;
		f.action=f.action+"&account_no="+${account_no};
		f.submit();
	}
</script>
<style type="text/css">
	body {
			background:url(pics/bg.jpg);
			-webkit-background-size: cover;
			-moz-background-size: cover;
			background-size: cover;
		}
</style>
</head>
<body>
	<div id="wrapper">
		<div id="title">赎回基金列表</div>
		<div id="qryarea">
			<form action=" <c:url value="/fundMgr?act=forsell"/>" method="post">

			</form>
		</div>
		<div>
			<table id="listtable" cellpadding="0" cellspacing="0">
				<tr>
					<th>账户编号</th>
					<th>基金编号</th>
					<th>基金数量</th>
					<th>操作</th>
				</tr>
				<c:forEach var="fundHolding" items="${page.pageContent}">
					<tr>
						<td>${ fundHolding.accountNo}</td>
						<td>${ fundHolding.fundNo}</td>
						<td>${ fundHolding.amount}</td>
						<td>
							<button style="height=20px;width=50px"
								title="点击赎回[${ fundHolding.fundNo}]号基金"
								onclick="sell(${ fundHolding.fundNo},${account_no});">赎回</button>
						</td>
					</tr>
				</c:forEach>
			</table>
			
			<div id="pageinfo">
	                            共${page.totalRecNum}条, 当前显示${page.startIndex}-${page.endIndex}条, 第${page.pageNo}/${page.totalPageNum}页
	           |
	           <c:if test="${page.pageNo>1}">
	             <span class="linkspan" onclick="doQuery(1)">首页</span>&nbsp;
	           </c:if>
	           <c:if test="${page.prePage}">
	             <span class="linkspan" onclick="doQuery(${page.pageNo-1})">上一页</span>&nbsp;
	           </c:if>
	           <c:if test="${page.nextPage}">
	             <span class="linkspan" onclick="doQuery(${page.pageNo+1})">下一页</span>&nbsp;
	           </c:if>
	           <c:if test="${page.pageNo!=page.totalPageNum}">
	             <span class="linkspan" onclick="doQuery(${page.totalPageNum})">末页</span>&nbsp;
	           </c:if>
	           |
	                             到<input type="text" id="pageNo" size=4 style="text-align:right;" onkeypress="onlynumber();"/> 页
	           <button onclick="doQuery($('pageNo').value);"> 跳 转 </button>		           		           	           	              
	        </div>
		</div>
	</div>
</body>

<c:if test="${not empty msg}">
	<script type="text/javascript">
		alert('${msg}');
	</script>
</c:if>

<c:if test="${not empty fail_msg}">
	<script type="text/javascript">
		alert('${fail_msg}');
	</script>
</c:if>
</html>
